-
Notifications
You must be signed in to change notification settings - Fork 244
Remove Duplicate HP setter #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devnet-ready
Are you sure you want to change the base?
Conversation
// DispatchError::BadOrigin | ||
// ); | ||
// }); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// } |
Trust VCS. If you'll ever need this code back, it will be in the repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented it out instead of deleting it to make it more difficult for somebody to re-use the extrinsic index. Substrate doesn't like that.
/// Change the SubnetOwnerHotkey for a given subnet. | ||
/// | ||
/// # Arguments | ||
/// * `origin` - The origin of the call, which must be the subnet owner. | ||
/// * `netuid` - The unique identifier for the subnet. | ||
/// * `hotkey` - The new hotkey for the subnet owner. | ||
/// | ||
/// # Errors | ||
/// * `BadOrigin` - If the caller is not the subnet owner or root account. | ||
/// | ||
/// # Weight | ||
/// Weight is handled by the `#[pallet::weight]` attribute. | ||
#[pallet::call_index(64)] | ||
#[pallet::weight((0, DispatchClass::Operational, Pays::No))] | ||
pub fn sudo_set_subnet_owner_hotkey( | ||
origin: OriginFor<T>, | ||
netuid: NetUid, | ||
hotkey: <T as frame_system::Config>::AccountId, | ||
) -> DispatchResult { | ||
pallet_subtensor::Pallet::<T>::ensure_subnet_owner(origin.clone(), netuid)?; | ||
pallet_subtensor::Pallet::<T>::set_subnet_owner_hotkey(netuid, &hotkey); | ||
|
||
log::debug!("SubnetOwnerHotkeySet( netuid: {netuid:?}, hotkey: {hotkey:?} )"); | ||
Ok(()) | ||
pallet_subtensor::Pallet::<T>::do_set_sn_owner_hotkey(origin, netuid, &hotkey) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another function that does the same thing in the same file, one has "sn" in the name and the other has "subnet". Do we need both? What for?
I'm not sure which one Cortex uses, I'd keep that one and remove the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cortex uses neither at the moment.
Actually, I looked at the copy of the code on the |
Description
This PR removes a duplicate hyperparameter extrinsic in admin-utils.